package com.sigmatrix.h5.web.controller.utils;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.sigmatrix.h5.auth.AuthenticationInfo;
import com.sigmatrix.h5.service.common.ServiceHelper;
import com.sigmatrix.h5.service.rebate.IRebateHandle;
import com.sigmatrix.h5.service.rebate.IRebateResult;
import com.sigmatrix.h5.service.rebate.demo.a.ARebateInput;
import com.sigmatrix.h5.web.BaseController;

/**
 * 返利业务流-测试
 * 
 * @author wei.wang
 *
 */
@RestController
@RequestMapping("/util/test/rebate/biz")
public class TestRebateBizDemoController extends BaseController {

	
	@Autowired
	private ServiceHelper serviceHelper;
	

	//ok
	@GetMapping("/esecode/{eseCode}")
	public void test(@PathVariable String eseCode) {
		IRebateHandle<?> rebateHandler = serviceHelper.selectService(eseCode, IRebateHandle.class);
		AuthenticationInfo userInfo =new AuthenticationInfo();
		userInfo.setAcctId(1);
		userInfo.setAcctType((short)1);
		userInfo.setDealerOrShopId(1);
		IRebateResult result = rebateHandler.doProcess(new ARebateInput(), userInfo);
		System.out.println(result);
	}
	
}
